
package nc.impl.arap.hsbceexitbankpay.hsbceexitbankpayvo;

import nc.bs.pfxx.plugin.AbstractPfxxPlugin;
import nc.vo.pub.BusinessException;
import nc.bs.pfxx.ISwapContext;
import nc.vo.pfxx.auxiliary.AggxsysregisterVO;
import nc.vo.pfxx.util.PfxxPluginUtils;
import nc.bs.framework.common.NCLocator;
import nc.vo.arap.hsbcebankpay.AggHsbcEexitbankPayVO;
import nc.itf.arap.hsbceexitbankpay.hsbceexitbankpayvo.IHsbcEexitbankPayVOService;

public class HsbcEexitbankPayVOPfxxPlugin extends AbstractPfxxPlugin {
	
	@Override
	protected Object processBill(Object vo, ISwapContext swapContext, AggxsysregisterVO aggxsysvo)
			throws BusinessException {
		AggHsbcEexitbankPayVO entityVO = (AggHsbcEexitbankPayVO)vo;
		String vopk = PfxxPluginUtils.queryBillPKBeforeSaveOrUpdate(swapContext.getBilltype(), swapContext.getDocID());
		entityVO.getParentVO().setPrimaryKey(vopk);
		AggHsbcEexitbankPayVO[] saveVO = getService().saveAggHsbcEexitbankPayVO(entityVO);
		return saveVO;
	}
	
	private IHsbcEexitbankPayVOService getService() {
		return NCLocator.getInstance().lookup(IHsbcEexitbankPayVOService.class);
	}
}